import { reqTradeInfo } from '@/api';


export default {
    actions: {
        //获取订单信息
        async getTradeInfo({ commit }) {
            let result = await reqTradeInfo();
            if (result.code === 200) {
                commit('GETTRADEINFO', result.data);
            }
        },
    },
    mutations: {
        GETTRADEINFO(state, tradeList) {
            state.tradeList = tradeList;
        }
    },
    getters: {
        userAddressList({ tradeList: { userAddressList } }) {
            return userAddressList || [];
        },
        tradeList({ tradeList }) {
            return tradeList || {};
        },
        detailArrayList({ tradeList: { detailArrayList } }) {
            return detailArrayList || [];
        }
    },
    state: {
        tradeList: {}
    }
}